package com.wx.chapter8.homework10;

/**
 * ClassName:Doctor
 * Package :com.wx.chapter8.homework10
 * Description :
 *
 * @Author : coder_mu
 * @Create : 2023/5/29 - 18:53
 */
public class Doctor {
    //相关属性
    private String name;
    private int age;
    private String job;
    private char gender;
    private double sal;

    //重写父类的equals()方法
    @Override
    public boolean equals(Object obj) {
        if (this == obj) {//判断地址是否相同
            return true;
        }
        //判断obj是否是Doctor类型或其子类
        if (!(obj instanceof Doctor)) {
            return false;
        }
        Doctor doctor = (Doctor) obj;
        return this.name.equals(doctor.name) && this.age == doctor.age && this.gender == doctor.gender && this.job.equals(doctor.job) && this.sal == doctor.sal;
    }

    //五个参数的构造器
    public Doctor(String name, int age, String job, char gender, double sal) {
        this.name = name;
        this.age = age;
        this.job = job;
        this.gender = gender;
        this.sal = sal;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }

    public char getGender() {
        return gender;
    }

    public void setGender(char gender) {
        this.gender = gender;
    }

    public double getSal() {
        return sal;
    }

    public void setSal(double sal) {
        this.sal = sal;
    }
}
